<template>
  <view class="r">
    <view class=""></view>
  </view>
</template>

<script>
let requestUtil = require('../../utils/requestUtil.js');
export default {
  data() {
    return {};
  } /*
1 两个推广链接 
到首页 https://admin.zju-gk.com/downLoad/home/
    /pages/index/index
到业务 https://admin.zju-gk.com/downLoad/edit/?code=09928202
    /pages/edit/edit
2 在edit 携带参数 跳转到固定页面
    onload解析数据得到终端号09928202 09928202_01
    判断并且跳转到制定的页面
const scancode_time = parseInt(query.scancode_time)     // 获取用户扫码时间 UNIX 时间戳
//console.log( encodeURIComponent("https://admin.zju-gk.com/downLoad/edit/?code=09928202") )
*/,
  onLoad(query) {
    if (query.q) {
      const qrUrl = decodeURIComponent(query.q); //1 decodeURI 获取到二维码原始链接内容
      console.log(qrUrl);
      const deviceCode = requestUtil.getQueryString(qrUrl, 'code'); //2 截取有效字符串
      console.log(deviceCode);
      if (deviceCode.indexOf('_') > 0) {
        //3 判断跳转方向
        //新协议
        uni.navigateTo({
          url: '/pages/tidNEWSelMoney/tidNEWSelMoney?device_code=' + deviceCode
        });
      } else {
        //老协议
        uni.navigateTo({
          url: '/pages/tidOLDSelMoney/tidOLDSelMoney?device_code=' + deviceCode
        });
      }
    }
  },
  methods: {}
};
</script>
<style>
@import "./edit.css";
</style>
